<script setup>
import { useRouter } from 'vue-router'
import { useUserStore } from '../store/user'
const router = useRouter()
const userStore = useUserStore()
const btnClick = () => {
  router.push('/?id=123')
}
</script>

<template>
  <div class="user-page">
    user
    <button @click="btnClick">跳转到home页</button>
    <hr />
    <h3>{{ userStore.num }}</h3>
    <h3>{{ userStore.getNum }}</h3>
    <button @click="userStore.setNum(Date.now())">调用修改方法</button>
  </div>
</template>

<style scoped>
.user-page {
  width: 300px;
  height: 300px;
  border: 5px solid red;
}
</style>
